package com.codecash.service;

import com.codecash.entity.PageBean;
import com.codecash.entity.Task;
import com.codecash.entity.TaskOrder;

import java.util.List;

public interface TaskService {
    //发布任务
    void create(Task task);
    //查询任务
    Task getTaskById(Long id);
    //修改任务
    void update(Task task) throws Exception;
    //删除任务
    void delete(Task task) throws Exception;

    //列表分页查询
    PageBean<Task> list(Integer pageNum, Integer pageSize, Integer taskId);

    //查询用户任务
    List<Task> findAllmyTasks(Long currentUserId);

    void orderTask(Long taskId, Long userId) throws Exception;

    // 获取用户订单列表
    List<TaskOrder> getUserOrders(Long userId);

    // 更新订单状态
    void updateOrderStatus(Long orderId, Long userId, String status) throws Exception;

    // 获取订单详情
    TaskOrder getOrderById(Long orderId) throws Exception;

    // 通过taskId更新订单状态
    void updateOrderStatusByTaskId(Long taskId, Long userId, String status) throws Exception;
}